package converters;

import com.thoughtworks.xstream.converters.SingleValueConverter;

import ctaModel.Id;

public class IdConverter implements SingleValueConverter{

	@Override
	public Object fromString(String obj) {
		return new Id(obj);
	}

	@Override
	public String toString(Object id) {
		return ((Id) id).getId();
	}

	@Override
	public boolean canConvert(Class type) {
		return type.equals(Id.class);
	}

}
